package com.oromwin.repos.data;

import java.io.File;

import com.oromwin.repos.common.Common;
import com.oromwin.repos.common.Common.Category;
import com.oromwin.repos.common.Common.Status;

public class FileTable extends AbstractReposTable {
    private String VolumeId = null;
    private String MediaId = null; 
    private String FileId = null; 
    private String FileFormat = Common.FileExt.BINFILE; 
    private File FilePath = null; 
    private Long FileBytes = 0L; 
    private String FileCategory = Category.NORMAL; 
    private Status FileStatus = Status.CREATE; 
    private Boolean PdfConvFlag = Boolean.FALSE; 
    private Boolean CompressionFlag = Boolean.FALSE; 
    private String CreateDate = null;
    private String UpdateDate = null;
    public FileTable() {
    }
    public FileTable(String volumeId, String mediaId, String fileId, String fileFormat, File filePath, Long fileBytes, String fileCategory, Status fileStatus, Boolean pdfConvFlag, Boolean compressionFlag, String createDate, String updateDate) {
        VolumeId = volumeId;
        MediaId = mediaId;
        FileId = fileId;
        FileFormat = fileFormat;
        FilePath = filePath;
        FileBytes = fileBytes;
        FileCategory = fileCategory;
        FileStatus = fileStatus;
        PdfConvFlag = pdfConvFlag;
        CompressionFlag = compressionFlag;
        CreateDate = createDate;
        UpdateDate = updateDate;
    }
    public String getVolumeId() {
        return VolumeId;
    }
    public void setVolumeId(String volumeId) {
        this.VolumeId = volumeId;
    }
    public String getMediaId() {
        return MediaId;
    }
    public void setMediaId(String mediaId) {
        this.MediaId = mediaId;
    }
    public String getFileId() {
        return FileId;
    }
    public void setFileId(String fileId) {
        this.FileId = fileId;
    }
    public String getFileFormat() {
        return FileFormat;
    }
    public void setFileFormat(String fileFormat) {
        this.FileFormat = fileFormat;
    }
    public File getFilePath() {
        return FilePath;
    }
    public void setFilePath(File filePath) {
        this.FilePath = filePath;
    }
    public Long getFileBytes() {
        return FileBytes;
    }
    public void setFileBytes(Long fileBytes) {
        this.FileBytes = fileBytes;
    }
    public String getFileCategory() {
        return FileCategory;
    }
    public void setFileCategory(String fileCategory) {
        this.FileCategory = fileCategory;
    }
    public Integer getFileStatus() {
        return FileStatus.ordinal();
    }
    public void setFileStatus(Integer fileStatus) {
        this.FileStatus = Status.values()[fileStatus];
    }
    public Boolean getPdfConvFlag() {
        return PdfConvFlag;
    }
    public void setPdfConvFlag(Boolean pdfConvFlag) {
        this.PdfConvFlag = pdfConvFlag;
    }
    public Boolean getCompressionFlag() {
        return CompressionFlag;
    }
    public void setCompressionFlag(Boolean compressionFlag) {
        this.CompressionFlag = compressionFlag;
    }
    public String getCreateDate() {
        return CreateDate;
    }
    public void setCreateDate(String createDate) {
        this.CreateDate = createDate;
    }
    public String getUpdateDate() {
        return UpdateDate;
    }
    public void setUpdateDate(String updateDate) {
        this.UpdateDate = updateDate;
    }
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append(String.format("VolumeId/\t%s\n", VolumeId));
        sb.append(String.format("MediaId/\t%s\n", MediaId));
        sb.append(String.format("FileId/\t%s\n", FileId));
        sb.append(String.format("FileFormat/\t%s\n", FileFormat));
        sb.append(String.format("FilePath/\t%s\n", FilePath));
        sb.append(String.format("FileBytes/\t%d\n", FileBytes));
        sb.append(String.format("FileCategory/\t%s\n", FileCategory));
        sb.append(String.format("FileStatus/\t%s\n", FileStatus.toString()));
        sb.append(String.format("PdfConvFlag/\t%s\n", PdfConvFlag.toString()));
        sb.append(String.format("CompressionFlag/\t%s\n", CompressionFlag.toString()));
        sb.append(String.format("CreateDate/\t%s\n", CreateDate.toString()));
        sb.append(String.format("UpdateDate/\t%s\n", UpdateDate.toString()));
        return sb.toString();
    }
    public File getFullFilepath() {
        return new File(FilePath, FileId);
    }
}
